@extends('layout.app')
@section('content')
    <ul class="nav nav-tabs">
        <li class="active"><a href="#home" data-toggle="tab">视频信息</a></li>
        {{--<li><a href="#profile" data-toggle="tab">培训简介</a></li>--}}
        {{--<li><a href="#profile" data-toggle="tab">宣传标语</a></li>--}}
    </ul>
    <div class="row">
        <div class="col-md-6">
            @if($errors->any())
                <ul class="list-group">
                    @foreach($errors->all() as $error)
                        <li class="list-group-item list-group-item-danger">{{$error}}</li>
                    @endforeach
                </ul>
            @endif
            <br>
            {!! Form::open(['url'=>'admin/'.$modelurl,'id'=>'tab','files'=>true]) !!}
            <div id="myTabContent" class="tab-content">
                <div class="tab-pane active in" id="home">
                    @foreach($formhead as $head)
                        @if($head[1]=='cover_image'||$head[1]=='soft_image' )
                            {!! Form::label($head[1],$head[0].':') !!}
                            {!! Form::file($head[1],['class'=>'form-control','id'=>'image']) !!}
                            @continue
                        @endif
                        @if($head[1]=='club' )

                            @continue
                        @endif
                        @if($head[1]=='mentor' )
                            <script type="text/javascript">
                                $(function() {
                                    $(".js-example-basic-multiple").select2({
                                        placeholder: "选择教练"
                                    });
                                });    </script>
                            <div class="form-group">
                                {{--,'multiple'=>'multiple'--}}
                                {!! Form::label('mentor','选择权限') !!}
                                {!! Form::select('mentor',$mentors,null,['class'=>'form-control js-example-basic-multiple']) !!}
                            </div>
                            @continue
                        @endif

                        <div class="form-group">
                            {!! Form::label($head[1],$head[0].':') !!}
                            {!! Form::text($head[1],null,['class'=>'form-control']) !!}
                        </div>
                    @endforeach
                </div>

            </div>
            <div class="btn-toolbar list-toolbar">
                {!! Form::submit('立即添加',['class'=>'btn btn-primary ']) !!}
                <a href="/admin/{{$modelurl}}/" data-toggle="modal" class="btn btn-danger">返回</a>
            </div>
            {!! Form::close() !!}
        </div>
    </div>
    <script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
@stop
